home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
0022-3.564
/
dmg-0143
/
articles
/
gfa2.doc
< prev
next >
Wrap
Text File
|
1997-04-16
|
3KB
|
107 lines
-------------------
GFA TUTORIAL PART 2
-------------------
Written by Paul Bramwell
Welcome to the GFA Tutorial, elsewhere in the menus you will find
part one which told you how to correct the colours for GFA Basic
2. This part will tell you a few commands and useful hinters.
SCREENS
-------
Loading a picture:
------------------
DEGAS ELITE
Bload "picture.pi1",Xbios(3)-34 Load pic in memory
Void Xbios(6,L:Xbios(3)-32) Corrects palette
The above is the same for medium and high resolution screens too.
GFA FORMAT
Bload "picture.pi1",32000
Void Xbios(6,L:32000)
Saving a picture:
-----------------
Use the following program:
DIM reg%(15) ! Leave room fo 15 registers
Res%=MKI$(Xbios(4)) ! Current resolution as a string
SGET scr$ ! Get Screen as a string
For r%=0 to 15
reg%(r%)=Xbios(7,r%,-1) AND &H777 ! Get the registers contents
palette$=palette$+MKI$(reg%(r%)) ! Throw it into a string
Next r%
f$=res%+palette$+scr$ ! Puts them all together
BSAVE "picture.pic",VARPTR(f$),32034 ! Save piccy
Void Commands
-------------
A useful expression when entering text:
Void Xbios(11,Bios(11,-1)OR &H10) ! On
Void Bios(11,Bios(11,-1)AND &HEF) ! Off
Void inp(2) ! Waits for a keypress, ignoring input
Machine Code
------------
Supposing you have got your .prg file, say musix, you can either
do this:
Dim Biffer%(Length/4) ! Store room for it
Bload "MUSIC1.PRG",varptyr(biffer%(0)) ! Load it in
'
M%=varptr(biffer%(0)) ! Call it back
Void C:m%()
Or alternatively
Reserve Fre(0)-10000 ! Reserve some memory
Exec 0,"Machine.Prg","","" ! Load it in and go
Reserve Fre(0)+10000-250 ! After, get memory back
Disabling that Mouse
--------------------
Out 4,18 ! Disable Mouse
Out 4,8 ! Enable it
Supervisor Mode
---------------
As in machine code, to get full attention for your program:
Supervisor%=Gemdos(32,L:0) ! On
~GEMDOS(32,L:supervisor%) ! Off
Thats IT!
---------
Thats it for this issue, next issue (if possible) we will show
you BMOVE, PUT, and GET and how to draw some BOXES and ALERTS!